<template>
	<div>
		<view class="search">
			<u--input placeholder="请输入工作任务" :clearable="true" prefixIcon="search"
				prefixIconStyle="font-size: 22px;color: #909399" v-model="query.workTasks " @confirm="getList"
				@clear="clear">
				<template slot="suffix">
					<view class="search_btn" @click="getList"> 搜索</view>
				</template></u--input>
		</view>
		<view class="box" v-for=" (v,i) in list" :key="i">
			<view class="box_item">
				<view class="box_label">督办类型：</view>
				<view class="box_value">{{v.handleTypeStr}}</view>
			</view>
			<view class="box_item">
				<view class="box_label">工作内容：</view>
				<view class="box_value">{{v.workTasks}}</view>
			</view>
			<view class="box_item">
				<view class="box_label"> 责任人：</view>
				<view class="box_value">{{v.onusUserStr}}</view>
			</view>
			<view class="box_item">
				<view class="box_label">计划时间：</view>
				<view class="box_value">{{v.issuedTime}}</view>
			</view>
			<view class="box_item_btn">
				<view class="box_item_btn_left" style="margin-right: 38rpx;background-color: rgba(112, 182, 3, 1);" @click="jumpTo('/pages/supervise/IssuanceRecord',{
					id:v.id
				})">
					下发记录 {{v.issueCount}}</view>
				<view class="box_item_btn_left "  style="margin-right: 38rpx;" v-if="v.identity == 2" @click="jumpTo('/pages/supervise/task',{
					type:1,
					endDate:v.endDate,
					startDate:v.startDate,
					id:v.id
				})">任务分解
					{{v.decomposeCount}}
				</view>
				<view class="box_item_btn_right" @click="jumpTo('/pages/supervise/taskProcessing',{
					id:v.id
				})"> 
					去处理
				</view>
			</view>
		</view>
	
	
	<u-empty mode="list" v-if="list.length<=0" marginTop="80">
	</u-empty>
	</div>
</template>

<script>
	import {pendingTasksList} from '@/api/supervise.js'
	export default {
		data() {
			return {
				query: {
					workTasks: '',
					PAGE_NO: 1,
					PAGE_SIZE: 100000
				},
				list: []
			}
		},
		onLoad() {
			if (this.$mp.query.token) {
				uni.setStorageSync('token', this.$mp.query.token)
			}
			this.getList()
		},
		onShow(){
			uni.$once('back',e=>{
				this.getList()
			})
		},
		methods: {
			search() {

			},
			getList(){
				pendingTasksList(this.query).then(res=>{
					this.list = res.rows
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #F6F6F6;
	}
</style>
<style lang="scss" scoped>
	.search {

		/deep/.u-input {
			width: 688rpx;
			height: 65rpx;
			background: #FFFFFF;
			border: 1rpx solid #CCCCCC;
			margin: 0 auto;
			margin-top: 15rpx;
			border-radius: 32rpx;
		}

		&_btn {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 29rpx;
			color: #666666;
			padding-left: 10rpx;
			border-left: 1rpx solid #E0E0E0;
		}
	}

	.box {
		width: 721rpx;
		background: #FFFFFF;
		margin: 0 auto;
		margin-top: 23rpx;
		border-radius: 15rpx;
		padding: 0 15rpx;
		padding-top: 15rpx;

		&_herder {
			padding: 30rpx 15rpx 25rpx 15rpx;
			border-bottom: 1rpx solid #F5F5F5;

			&_left {
				font-weight: 400;
				font-size: 33rpx;
				color: #1F1F1F;
				font-style: normal;
			}

			&_right {
				background: #FFDFDC;
				border-radius: 10rpx;
				border: 1rpx solid #E04734;
				padding: 14rpx 18rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 25rpx;
				color: #E04734;
			}

			&_right1 {
				background: #FFECDC;
				border-radius: 10rpx;
				border: 1rpx solid #E08A34;
				padding: 14rpx 18rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 25rpx;
				color: #E08A34;
			}
		}

		&_item {
			display: flex;
			align-items: center;
			margin-top: 30rpx;
			padding: 0 15rpx;

			&_btn {
				margin-top: 30rpx;
				border-top: 1rpx solid #F5F5F5;
				display: flex;
				// justify-content: right;
				padding-top: 33rpx;
				padding-bottom: 23rpx;
				// padding-right: 30rpx;
				justify-content: flex-end;

				&_left {
					width: 171rpx;
					height: 63rpx;
					background: #F6A234;
					border-radius: 31rpx;

					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 25rpx;
					color: #FFFFFF;
					line-height: 63rpx;
					text-align: center;
					// margin-right: 38rpx;
				}

				&_right {
					width: 171rpx;
					height: 63rpx;
					background: #267DFF;
					border-radius: 31rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 25rpx;
					color: #FFFFFF;
					line-height: 63rpx;
					text-align: center;
					font-style: normal;
					// margin-left: 38rpx;
				}
			}
		}

		&_label {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 29rpx;
			color: #999999;
		}

		&_value {
			font-weight: 400;
			font-size: 29rpx;
			color: #1F1F1F;
		}
	}
</style>